package fmse.uaic.k.configuration_abstraction.exceptions;

import java.util.List;

import fmse.uaic.k.configuration_abstraction.abstract_classes.KAbstractNode;

public class NotDeclaredLabelException extends Exception {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 8119638909761886479L;

	private KAbstractNode node;
	private int line;
	private List<KAbstractNode> missingDeclarations;

	public NotDeclaredLabelException(KAbstractNode node, int line,
			List<KAbstractNode> missingDeclarations) {
		super();
		this.node = node;
		this.line = line;
		this.missingDeclarations = missingDeclarations;
	}

	@Override
	public String toString() {
		String out = "Error(" + node + ", " + line
				+ "): undeclared cell labels: ";
		for (KAbstractNode node : missingDeclarations)
			out += node.getLabel() + "  ";
		return out;
	}
}
